import request from '../utils/request'

// 获取所有订单详情
export const listOrderDetails = () => {
  return request({
    url: '/orderDetail/list',
    method: 'get'
  })
}

// 根据id获取订单详情
export const getOrderDetailById = (id) => {
  return request({
    url: `/orderDetail/${id}`,
    method: 'get'
  })
}

// 添加订单详情
export const addOrderDetail = (data) => {
  return request({
    url: '/orderDetail',
    method: 'post',
    data
  })
}

// 根据订单ID获取订单详情
export const listOrderDetailByOrderId = (orderId) => {
  return request({
    url: `/orderDetail/listOrderDetailByOrderId/${orderId}`,
    method: 'get'
  });
}; 